package com.bigegg.employee.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.bigegg.employee.mapper.BoardMapper;
import com.bigegg.employee.domain.Board;
import com.bigegg.employee.service.IBoardService;

/**
 * 招聘公告Service业务层处理
 * 
 * @author sun
 * @date 2022-08-15
 */
@Service
public class BoardServiceImpl implements IBoardService 
{
    @Autowired
    private BoardMapper boardMapper;

    /**
     * 查询招聘公告
     * 
     * @param id 招聘公告主键
     * @return 招聘公告
     */
    @Override
    public Board selectBoardById(Long id)
    {
        return boardMapper.selectBoardById(id);
    }

    /**
     * 查询招聘公告列表
     * 
     * @param board 招聘公告
     * @return 招聘公告
     */
    @Override
    public List<Board> selectBoardList(Board board)
    {
        return boardMapper.selectBoardList(board);
    }

    /**
     * 新增招聘公告
     * 
     * @param board 招聘公告
     * @return 结果
     */
    @Override
    public int insertBoard(Board board)
    {
        board.setCreateTime(DateUtils.getNowDate());
        return boardMapper.insertBoard(board);
    }

    /**
     * 修改招聘公告
     * 
     * @param board 招聘公告
     * @return 结果
     */
    @Override
    public int updateBoard(Board board)
    {
        board.setUpdateTime(DateUtils.getNowDate());
        return boardMapper.updateBoard(board);
    }

    /**
     * 批量删除招聘公告
     * 
     * @param ids 需要删除的招聘公告主键
     * @return 结果
     */
    @Override
    public int deleteBoardByIds(Long[] ids)
    {
        return boardMapper.deleteBoardByIds(ids);
    }

    /**
     * 删除招聘公告信息
     * 
     * @param id 招聘公告主键
     * @return 结果
     */
    @Override
    public int deleteBoardById(Long id)
    {
        return boardMapper.deleteBoardById(id);
    }
}
